package com.caesar.iostream;

import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

/**
 * @author caesar
 * @date 2025/7/13
 * @Description:
 * @apiNote
 */
public class exer3_2 {
    public static void main(String[] args) throws IOException {
        //1.创建流对象
        FileReader fr = new FileReader("D:\\hello.java");
        FileWriter fw = new FileWriter("D:\\hello_副本.java");
        //2.读写数据

        char[] data = new char[1024];
        int len = 0;
        while((len=fr.read(data)) != -1){
            fw.write(data,0,len);
        }
        fr.close();
        fw.close();
    }
}
